const fs = require('node:fs')

const writeStream = fs.createWriteStream('E://气候数据//Data_ancillary//yxd2.nc')
// // node:fs/promise 模块里没有createReadStream
const readStream = fs.createReadStream('E://气候数据//Data_ancillary//elev_CMFD_V0106_B-01_010deg.nc')

// readStream.on('data', (data) => {
//     // console.log(data.toString('utf-8'))
//     readStream.pause()
//     writeStream.write(data)
// })

// readStream.on('end', () => {
//     readStream.close()
//     writeStream.close()
// })
// // readStream.
// // 写文件流
// writeStream.on('drain', () => {
//     console.log('finish')
//     readStream.resume()
// })

readStream.pipe(writeStream)